home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / BitShift.au3 < prev    next >
Text File  |  2007-09-08  |  304b  |  10 lines

  1. $x = BitShift(14, 2)
  2. ;  x == 3 because 1110b right-shifted twice is 11b == 3
  3.  
  4. $y = BitShift(14, -2)
  5. ;  y == 56 because 1110b left-shifted twice is 111000b == 56
  6.  
  7. $z = BitShift( 1, -31)
  8. ;  z == -2147483648 because in 2's-complement notation, the
  9. ;  32nd digit from the right has a negative sign.
  10.